﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using WmsApp.WmsService;

namespace WmsApp.Service
{
    public class SystemUserService : IEntityService<SystemUser, SystemUserService>
    {
        #region IEntityService<SystemUser> Members

        public List<SystemUser> GetEntityList()
        {
            var sc = Factory.WmsServiceFactory.GetServiceClient();
            List<SystemUser> list = sc.GetSystemUsers();
            foreach (var user in list)
            {
                user.BindPropertyChanged();
            }
            return list;
        }

        public List<SystemUser> GetEntityList(string condition)
        {
            throw new NotImplementedException();
        }

        public void SaveEntityList(List<SystemUser> list)
        {
            var sc = Factory.WmsServiceFactory.GetServiceClient();
            sc.SaveSystemUsers(list);
            foreach (var user in list)
            {
                user.WcfEntityState = EntityState.Unchanged;
            }
        }

        public SystemUser GetEntity(string key)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
